package com.example.romibotest;

import java.util.Timer;
import java.util.TimerTask;

public class TimedResponse {
	Timer t;
	Bluetooth b;
	public final static int[] DIFF_WAITS = {90,10,15,20};
	
	public TimedResponse(int difficulty, Bluetooth bluetooth){
		b = bluetooth;
		t = new Timer();
		t.schedule(new AlertRobot(),DIFF_WAITS[difficulty] * 1000, DIFF_WAITS[difficulty] * 1000);
	}
	
	public void interruptTimer(){
		t.cancel();
	}
	
	class AlertRobot extends TimerTask{
		public void run(){
			b.callComm("8");
		}
	}
}
